# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Pull Request Check

on:
  pull_request:
    branches: [ "develop" ]

permissions:
  contents: read

defaults:
  run:
    working-directory: ./user-profile-application

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - name: Git Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Setup JDK
        uses: actions/setup-java@v3
        with:
          distribution: adopt
          java-version: 17

      - name: Setup Gradle
        uses: gradle/gradle-build-action@v2

      - name: Run build with Gradle
        run: gradle build